package cn.cdeden.knowledge.controller.attention;


import cn.cdeden.common.core.domain.R;
import cn.cdeden.knowledge.domain.dto.FilesAttentionDto;
import cn.cdeden.knowledge.service.FilesAttentionService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
//@Api(tags = "我的关注管理")
@RequestMapping("/fileAttention")
public class FilesAttentionController {

    private final FilesAttentionService filesAttentionService;


    /**
     * 添加关注
     * @param resources
     * @return
     */
//    @Log("添加关注")
//    @ApiOperation("添加关注")
    @PostMapping(value = "/addAttention")
    @ResponseBody
    public R addAttention(@RequestBody FilesAttentionDto resources){
        return R.ok(filesAttentionService.insert(resources));
//        return BaseRespResult.successResult(filesAttentionService.insert(resources));
    }

    /**
     * 取消关注
     * @param resources
     * @return
     */
//    @Log("取消关注")
//    @ApiOperation("取消关注" )
    @PostMapping(value = "/cancelAttention")
    @ResponseBody
    public R cancelAttention(@RequestBody FilesAttentionDto resources){
        return R.ok(filesAttentionService.removeByMap(resources));
//        return BaseRespResult.successResult(filesAttentionService.removeByMap(resources));
    }

}
